<?php
namespace app\index\model;

use think\Model;

class Topic extends Model {
	protected $insert = [
		'reply_num' => 0,
		'if_top' => 0
	];

	public function user() {
		return $this->hasOne('User', 'id', 'uid')->field('id, username, fullname, avator_path, create_time, introduction, admin');
	}

	public function getCreateTimeAttr($time) {
	    return $time;
	}
}